﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CDB.LinqModel.Data;
using CDB.LinqData;
using CDB.LinqModel;

public partial class controls_testimonial : System.Web.UI.UserControl
{
    #region Variable Declration
    IDataRepository _dataObject = new DataRepository();
    Testimonial testimonial;
    List<Testimonial> testimonials = new List<Testimonial>();
    #endregion
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            FillTestimonials();
        }
    }
    private void FillTestimonials()
    {
        testimonial = new Testimonial(_dataObject);
        testimonials = testimonial.GetAllTestimonials();

        if (testimonials != null)
        {
            rptTestimonial.DataSource = testimonials;
            rptTestimonial.DataBind();
        }
    }
}